﻿using System;
using System.ComponentModel;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using static Modules.Payroll.PayrollConstants;

namespace Modules
{
    /// <summary>
    /// 发放工资操作日志
    ///</summary>
    [TableName("wage_payroll_log")]
    [Description("工资发放操作日志")]
    [PrimaryKey("Id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class WagePayrollLog : IEntity
    {
        /// <summary>
        ///
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 工资单Id
        ///</summary>
        [Column("wage_id")]
        public int? WageId { get; set; }

        /// <summary>
        /// 操作状态：0:创建 1：提交  2：撤销
        ///</summary>
        [Column("operation_type")]
        public 代发操作类型 OperationType { get; set; }

        /// <summary>
        /// 流水号
        ///</summary>
        [Column("tran_no")]
        public string TranNo { get; set; }

        /// <summary>
        /// 创建代发批次返回的合同号
        ///</summary>
        [Column("contract_no")]
        public string ContractNo { get; set; }

        /// <summary>
        /// 代发批次号
        ///</summary>
        [Column("batch_no")]
        public string BatchNo { get; set; }

        /// <summary>
        /// 统一支付的流水号
        ///</summary>
        [Column("bank_payment_no")]
        public string BankPaymentNo { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime? CreateTime { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}